<template>
	<view class="border-bottom border-light-secondary d-flex a-center py-2"
	@click="openGoodsDetailPage">
		<image :src="item.cover" 
		mode="widthFix"
		style="width: 150rpx;height: 150rpx;"
		class="rounded m-2 flex-shrink"></image>
		<view class="flex-1">
			<view class="d-flex a-center">
				<text class="font-md text-dark">{{item.title}}</text>
				<text class="font-md text-light-muted ml-auto">¥{{item.pprice}}</text>
			</view>
			<view class="d-flex a-center">
				<text class="font-md text-light-muted">{{item.attrs}}</text>
				<text class="font-md text-light-muted ml-auto">x{{item.num}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			item: Object,
			clickable: false
		},
		
		methods: {
			//跳转商品详情页
			openGoodsDetailPage() {
				if(this.clickable) {
					uni.navigateTo({
						url: '/pages/detail/detail'
					});
				}
			}
		}
	}
</script>

<style>
</style>
